<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // 常见的闭包形式 外部可以访问 函数内部的变量
        function outer() {
            let a = 10
            function fn() {
                console.log(a);
            }
            return fn
        }
        // outer()===fn=function fn(){}
        // const fun=function fn(){}
        const fun = outer()
        fun()//调用函数

    </script>
</body>

</html>